<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>P94 5.3.1 为什么使用构造函数</title>
</head>
<body>
    <script>
        function factory(name,age){
            var o={};
            o.name=name;
            o.age=age;
            return o;
        }
        var o1=factory('Jack',18);
        var o2=factory('Alice',19);
        console.log(o1);
        console.log(o2);
    </script>
    
</body>
</html>